// HtmlPage.h: interface for the HtmlPage class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HTMLPAGE_H__EEB5C4C7_BA70_4642_9004_B9D6D8D047EC__INCLUDED_)
#define AFX_HTMLPAGE_H__EEB5C4C7_BA70_4642_9004_B9D6D8D047EC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>

using namespace std;

#include "KeyPhraseCollection.h"

//extern "C" {
#include "extr_api.h"
//};

class FeatureItem{

private:

	long Index;
	double Weight;
	int Frequency;

public:

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

	FeatureItem():Index(0) , Weight(0) , Frequency(0){};
	FeatureItem( int LcIndex , double LcWeight ) : Index(LcIndex) , Weight(LcWeight) , Frequency(0){}
	virtual ~FeatureItem(){};


//////////////////////////////////////////////////////////////////////
// Gets/Sets/Destruction
//////////////////////////////////////////////////////////////////////


	int GetIndex(){ return Index; }
	long GetFrequency(){ return Frequency; }
	void SetIndex( long LcIndex ){ Index = LcIndex; }
	void SetFrequency( int LcFrequency ){ Frequency = LcFrequency; }
	double GetWeight(){ return Weight; }
	void SetWeight( double LcWeight ){ Weight = LcWeight; }

};//FeatureItem


typedef vector< FeatureItem > FeatureItemVector;



class HtmlPage
{
private:

	FeatureItemVector MyFeatures;
	string MyUrl;

public:
	
	
	HtmlPage(){};
	HtmlPage(string LcMyUrl){ MyUrl = LcMyUrl; };
	virtual ~HtmlPage(  ){ MyFeatures.clear(); };

	bool CheckEnglish(char *Phrase);
	int FindFrequency(string KeyPhrase , char *stream);	
	int GetNumOfIndexs(){ return MyFeatures.size(); }
	void SetMyUrl(string LcMyUrl){ MyUrl = LcMyUrl; };
	string GetMyUrl(){ return MyUrl; };
	bool GenerateTermsList( char* stream , void *StopMemory, KeyPhraseCollection &objKeyPhraseCollection , bool LearningPhase = true );
	FeatureItemVector GetFeatures(){return MyFeatures;};
};

typedef vector< HtmlPage > HtmlPageVector;

#endif // !defined(AFX_HTMLPAGE_H__EEB5C4C7_BA70_4642_9004_B9D6D8D047EC__INCLUDED_)
